using System;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using Controllers;

namespace ConsoleApp
{
	public class MultiRegistration
	{
		IWindsorContainer _container;

		public MultiRegistration()
		{
			_container = IoC.CreateContainer();

			_container.Register(
				AllTypes.Of<IController>()
					.FromAssemblyNamed("Controllers")
					);
		}

		public void Run()
		{
			foreach (var item in _container.ResolveAll<IController>())
			{
				Console.WriteLine(item.GetType() + Environment.NewLine);
			}
		}
	}
}
